package top.leix.springdemo.pojo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 学期表
 * @TableName terms
 */
@TableName(value ="terms")
@Data
public class Terms implements Serializable {
    /**
     * 学期
     */
    @TableField(value = "semester")
    private String semester;

    /**
     * 是否为当前学期
     */
    @TableField(value = "isNow")
    private Integer isNow;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Terms other = (Terms) that;
        return (this.getSemester() == null ? other.getSemester() == null : this.getSemester().equals(other.getSemester()))
            && (this.getIsNow() == null ? other.getIsNow() == null : this.getIsNow().equals(other.getIsNow()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getSemester() == null) ? 0 : getSemester().hashCode());
        result = prime * result + ((getIsNow() == null) ? 0 : getIsNow().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", semester=").append(semester);
        sb.append(", isNow=").append(isNow);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}